package com.djx.commons.response;


//放回结果枚举类   用于封装返回参数
public enum ResultCode {

    SUCCESS(true, 1000, "操作成功!"),
    FAIL(false, 2000, "操作失败!"),

    FIND_SUCCESS(true, 1001, "查询成功!"),
    FIND_FAIL(false, 2001, "查询失败!"),
    MODIFY_SUCCESS(true, 1002, "修改成功!"),
    MODIFY_FAIL(false, 2002, "修改失败!"),
    ADD_SUCCESS(true, 1003, "添加成功!"),
    ADD_FAIL(false, 2003, "添加失败!"),
    ADD_FAILONE(false, 2004, "用户名已存在,请重新添加"),
    DELETE_SUCCESS(true, 1004, "删除成功!"),
    DELETE_FAIL(false, 2004, "删除失败!"),
    USER_DISABLE(false, 2011, "该账号禁用！"),


    CONTACTANADMINISTRATOR(false, 3000, "系统故障,请联系管理员!"),
    LOGIN_TIME_OUT(false, 4000, "登录超时!"),

    LOGIN_FAIL(false, 2005, "登录失败,账号或密码有误!"),
    LOGIN_SUCCESS(true, 1005, "登录成功!"),
    LOGIN_FAIL_NO_USER(false, 2008, "账号不存在!"),
    LOGIN_FAIL_NO_PASSWORD(false, 2009, "密码输入错误!"),
    LOGIG_GUODUO(false, 2010, "登录次数过多"),

    UN_AUTHORISE(false, 2006, "权限不足！"),

    PARAMS_IS_NULL(false, 2007, "参数异常,请联系管理员");


    boolean success; //操作是否成功
    int code;  //操作相应码
    String message; //操作的信息


    ResultCode(boolean success, int code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
